<template>
  <span>
    <span class="point" :style="{ color: color }">●</span>
    <span>{{ scope.text }}</span>
  </span>
</template>

<script>
export default {
  props: {
    instance: Object, // 插槽实例
    scope: Object // text, row, index
  },
  data() {
    return {
      actionColorList: {
        0: '#C3C3C3',
        1: '#40B7BE',
        2: '#2279D2',
        3: '#F5222D'
      },
      userColor: {  // 用户管理的颜色
        0: '#40B7BE',
        1: '#C3C3C3'
      }
    }
  },
  computed: {
    color() {
      const { status, useStatus, auditStatus } = this.scope.scope
      const statusAudit = this.scope.text
      const expr = /审核/
      if (useStatus) {
        return this.userColor[useStatus]
      }
      if (auditStatus && statusAudit.search(expr) !== -1) {
        return this.actionColorList[auditStatus]
      }
      return this.actionColorList[status]
    }
  }
}
</script>
